package com.meichis.yndms.model;

import com.meichis.mcsappframework.utils.DateUtil;

import java.io.Serializable;
import java.util.ArrayList;

/**
 * Created by pei on 2016/8/24.
 */
public class VisitWorkItem_Promotion implements Serializable {
    // 归属拜访环节
    private int Job;
    //品牌
    private int Brand;

    private int BrandType;
    //品类
    private String PDTClassify = "";
    //促销方式
    private int PromotionType;
    //促销形式
    private int ActivityClassify;
    //开始日期
    private String BeginDate = "1900-01-01";
    //截止日期
    private String EndDate = "1900-01-01";
    //照片列表
    private String PhotosGUID = "";
    //备注
    private String Remark = "";

    private ArrayList<VisitWorkItem_PromotionInProduct> Products = new ArrayList<>();

    public int getJob() {
        return Job;
    }

    public void setJob(int job) {
        Job = job;
    }

    public int getBrand() {
        return Brand;
    }

    public void setBrand(int brand) {
        Brand = brand;
    }

    public int getBrandType() {
        return BrandType;
    }

    public void setBrandType(int brandType) {
        BrandType = brandType;
    }

    public String getPDTClassify() {
        return PDTClassify;
    }

    public void setPDTClassify(String PDTClassify) {
        this.PDTClassify = PDTClassify;
    }

    public int getPromotionType() {
        return PromotionType;
    }

    public void setPromotionType(int promotionType) {
        PromotionType = promotionType;
    }

    public int getActivityClassify() {
        return ActivityClassify;
    }

    public void setActivityClassify(int activityClassify) {
        ActivityClassify = activityClassify;
    }

    public String getBeginDate() {
        return BeginDate;
    }

    public void setBeginDate(String beginDate) {
        BeginDate = beginDate;
    }

    public String getEndDate() {
        return EndDate;
    }

    public void setEndDate(String endDate) {
        EndDate = endDate;
    }

    public String getRemark() {
        return Remark;
    }

    public void setRemark(String remark) {
        Remark = remark;
    }

    public String getPhotosGUID() {
        return PhotosGUID;
    }

    public void setPhotosGUID(String photosGUID) {
        PhotosGUID = photosGUID;
    }

    public ArrayList<VisitWorkItem_PromotionInProduct> getProducts() {
        return Products;
    }

    public void setProducts(ArrayList<VisitWorkItem_PromotionInProduct> products) {
        Products = products;
    }

    public String isFillComplete() {
        String result = null;
        if (BrandType==1) {//本品检查
            if (!DateUtil.CompareDate(BeginDate, EndDate, DateUtil.FORMAT_YMD)) {
                result = "本品日期顺序";
                return result;
            }
            if (PDTClassify.trim().equals("")) {
                result = "本品产品品类";
                return result;
            }
            if (getProducts() == null || getProducts().size() == 0) {
                result = "本品促销品项";
                return result;
            }
            if (Remark.trim().equals("")) {
                result = "本品描述";
                return result;
            }
            if (PhotosGUID.equals("")) {//如果取消照片检查，请确保执行Pic2GUID
                result = "本品活动实时照片";
                return result;
            }

        } else {
            if (!DateUtil.CompareDate(BeginDate, EndDate, DateUtil.FORMAT_YMD)) {
                result = "竞品日期顺序";
                return result;
            }
            if (Remark.trim().equals("")) {
                result = "竞品描述";
                return result;
            }
            if (PhotosGUID.trim().equals("")) {//如果取消照片检查，请确保执行Pic2GUID
                result = "竞品活动实时照片";
                return result;
            }
        }
        return result;
    }
}
